<html>
  
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title>Grade Bay</title>
		<link rel="stylesheet" href="gui.css" type="text/css" />
		<!--[if IE 7]>
			<link rel="stylesheet" href="css/ie7.css" type="text/css" />
		<![endif]-->
                 <script type="text/javascript" src="jquery-latest.pack.js"></script> 
                 <script type="text/javascript" src="javascript.js"></script>
                  <script type="text/javascript">
                      function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }
                        function addInput1stQuarter()
                        {
                                var x = document.getElementById("1stQuarter");
                                x.innerHTML += "<tr><td><p>Name:</p></td><td> <input  type='text' name='newcriteria[]' class='tf_effect'  /> </td><td><p>Percentage: </p></td><td> <input type='text' onkeypress='return isNumberKey(event)' maxlength='3' name='newcritPercent[]' class='tf_effect'  /></td>";
                        }
                        function addInput2ndQuarter()
                        {
                                var x = document.getElementById("2ndQuarter");
                                x.innerHTML += "<tr><td><p>Name:</p></td><td> <input  type='text' name='newcriteria1[]' class='tf_effect'  /> </td><td><p>Percentage: </p></td><td> <input type='text' onkeypress='return isNumberKey(event)' maxlength='3' name='newcritPercent1[]' class='tf_effect'/></td>";
                            }
                        function addInput3rdQuarter()
                        {
                                var x = document.getElementById("3rdQuarter");
                                x.innerHTML += "<tr><td><p>Name:</p></td><td> <input  type='text' name='newcriteria2[]' class='tf_effect'  /> </td><td><p>Percentage: </p></td><td> <input type='text' onkeypress='return isNumberKey(event)' maxlength='3' name='newcritPercent2[]' class='tf_effect'/></td>";
                            }
                        function addInput4thQuarter()
                        {
                                var x = document.getElementById("4thQuarter");
                                x.innerHTML += "<tr><td><p>Name:</p></td><td> <input  type='text' name='newcriteria3[]' class='tf_effect'  /> </td><td><p>Percentage: </p></td><td> <input type='text' onkeypress='return isNumberKey(event)' maxlength='3' name='newcritPercent3[]' class='tf_effect'  /></td>";
                            }
                        </script>
	</head>
	<body>
		<div class="page">
			<div class="header">
				<a href="index.php" id="logo"><img src="images/gradeBaylogo.png" width="330" height="79" alt=""/></a>
				<ul>
					<li class="selected"><a href="">EDIT SUBJECT</a></li>
                                        <li><a href="viewSubjects.php">BACK</a></li>
				
				</ul>
			</div>
			<div class="body">

<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
    include 'PHPClasses/DBAccess.php';
    include 'PHPClasses/SubjectDBAccess.php';
   

    if(!isset($_POST['subjectID'])){
        $subjectID=$_GET['subjectID'];
        
    }
    
    else{
        $subjectID=$_POST['subjectID'];
        
    }
    
    
     if(!isset($_GET['error'])){
         $_GET['error']=0;
     }
    
     if ($_GET['error']){ //If any errors display them  
               
           $errormsg = $_GET['error'] . ".<br>";
           echo "<p style='color:red;'>$errormsg</p>";
           
     }
     
    $DBAccess=new SubjectDBAccess();
    
    
     
    $DBAccess->viewEditSubject($subjectID);
    
    
    $DBAccess->DBDisconnect(); 
?>
                         
                        </div>
                    
			<div class="footer">
				
				<p>&#169; Copyright &#169; 2011. Company name all rights reserved</p>
				<div class="connect">
					<a href=""><img src="images/paragox.png" width=160" height="110" alt=""/></a>
					<a href=""><img src="images/fblogo.png" width=120" height="100" alt="" style="position:relative; left:-31px"/></a>
					<a href=""><img src="images/harmony.png" width=120" height="100" alt="" style="position:relative; left:0px"/></a>
				</div>
			</div>
		</div>
	</body>
</html> 